<?
require 'facebook.php';

$facebook = new Facebook(array(
  'appId'  => '271110082964987',
  'secret' => '161832861ef987ccc5b028d44838e9c8',
));

// Get User ID
$user = $facebook->getUser();


if ($user) {
  $profile_pic =  "http://graph.facebook.com/".$user."/picture";

 //echo the image out
 echo "Your profile picture: <img src=\"" . $profile_pic . "\" /><br>"; 
 echo "Your User ID: $user";
 $access_token = $facebook->getAccessToken();
 echo "<br>$access_token<br>";
 $link = 'https://graph.facebook.com/me/friends?access_token='.$access_token;
 echo $link;
// $infosite = file_get_contents('https://graph.facebook.com/me/friends?access_token='.$access_token);
// echo $infosite;
 
} else {
  echo 'You haven\'t logged in yet. Please Log In to use this app.';
}

?>